import request from "@/utils/request";

// 获取房屋列表
export function getHouses(params) {
	return request({
		url: "/house",
		method: "get",
		params,
	});
}

// 获取房屋详情
export function getHouse(id) {
	return request({
		url: `/house/${id}`,
		method: "get",
	});
}

// 创建房屋
export function createHouse(data) {
	return request({
		url: "/house",
		method: "post",
		data,
	});
}

// 更新房屋
export function updateHouse(id, data) {
	return request({
		url: `/house/${id}`,
		method: "put",
		data,
	});
}

// 更新房屋状态
export function updateHouseStatus(id, data) {
	return request({
		url: `/house/${id}/status`,
		method: "patch",
		data,
	});
}

// 删除房屋
export function deleteHouse(id) {
	return request({
		url: `/house/${id}`,
		method: "delete",
	});
}
